package asserttest;

import javafx.application.Application;
import javafx.stage.Stage;

public class AssertTest {

    private String name = null;

    public AssertTest(String name) {
        this.name = name;
    }

    public void setName(String nameStr) {
        this.name = nameStr;
    }

    public String getName() {
        return this.name;
    }

    public static void main(String[] args) {
        AssertTest personObj = new AssertTest("Abner Chai");
        String personName = null;
        personName = personObj.getName();
        //格式一
        assert personName != null;
        //格式二
        assert personName != null : "name in null";
        System.out.println(personName.length());
    }
}
